﻿''' <summary>
''' Custom implementation of the visibility converter, using the parameter as an indicator as to whether visibility should be determined by a true or false value.
''' </summary>
''' <remarks></remarks>
Public Class CustomBooleanToVisibilityConverter
	Implements IValueConverter

	Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
		Try
			If parameter Is Nothing Then
				If CBool(value) = True Then
					Return Visibility.Visible
				Else
					Return Visibility.Collapsed
				End If
			Else
				If CBool(value) = True Then
					Return Visibility.Collapsed
				Else
					Return Visibility.Visible
				End If
			End If
		Catch ex As Exception
			Return Visibility.Visible
		End Try
	End Function

	Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
		Throw New NotImplementedException
	End Function
End Class
